import request from '@/utils/request';
import {
	message
} from 'ant-design-vue';

export async function getOptFn(url, params, callBack) {
	let extra = {
		page: 1,
		page_size: 99999
	}
	params = {
		...params,
		...extra
	}
	const res = await request.post(url, {
		...params
	});
	if (res.data.code === 1) {
		callBack(res.data.data);
	} else if (res.data.code === 0) {
		message.error(res.data.msg);
	}
}

export default getOptFn;
